﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'SearchVehiculoPropio')
	BEGIN
		DROP  Procedure  SearchVehiculoPropio
	END

GO

CREATE Procedure SearchVehiculoPropio

	(
		@nroPlaca nvarchar(10)
	)

AS

BEGIN
	SET NOCOUNT ON
	
	SELECT
	VP.[FechaCompra],
	VP.[IdBien],
	VP.[IdVehiculoPropio],
	VP.[Precio],
	VP.[TarjetaPropiedad] 
	FROM [VehiculoPropio] AS VP
	INNER JOIN Vehiculo AS V ON VP.[IdBien] = V.[IdBien]
	WHERE V.[NroPlaca] LIKE (@nroPlaca + N'%')

	SET NOCOUNT OFF
END

GO


GRANT EXEC ON SearchVehiculoPropio TO PUBLIC

GO

